home *** CD-ROM | disk | FTP | other *** search
- #include "defs.h"
- #include "protos.h"
- #include "nullrev.h"
-
- long start(void) { return(-1); } /* in case somebody tries to run us */
-
- struct NullBase *DevBase = NULL;
- struct ExecBase *SysBase = NULL;
-
- char ID[] = "$VER: nullmodem "__VERSION__" ("__COMMODORE_DATE__") © 1993, 1994 Iain Hibbert\r\n";
- char DeviceName[] = "nullmodem.device";
-
- /*
- * the RomTag structure (const puts it in the code segment)
- */
- const struct Resident RomTag = {
- RTC_MATCHWORD,
- &RomTag,
- &RomTag+1, /* EndCode */
- 0, /* no flags */
- VERSION,
- NT_DEVICE,
- 0, /* zero priority */
- DeviceName,
- ID,
- DevInit
- };
-
- /*
- * initialise device (in a Forbid)
- *
- * NOTE! this is the first piece of code called, and as we have NO startup
- * code anywhere, we have to set up SysBase etc ourselves.. there is
- * NO auto-initialisation code anywhere, NO memory allocation, NO
- * clearing of BSS space.. we are totally on our own..
- *
- * segment pointer in A0
- */
- struct NullBase *
- DevInit(__A0 APTR seg)
- {
- struct NullBase *db;
- static APTR func_table[] = {
- DevOpen,
- DevClose,
- DevExpunge,
- DevReserved,
- DevBeginIO,
- DevAbortIO,
- -1
- };
-
- SysBase = *(struct ExecBase **)4;
-
- db = (struct NullBase *)MakeLibrary(func_table, NULL, NULL, sizeof(struct NullBase), NULL);
-
- if( db ) {
-
- /*
- * set up the device structure
- */
- DevBase = db;
-
- db->b_Lib.lib_Node.ln_Type = NT_DEVICE;
- db->b_Lib.lib_Node.ln_Name = DeviceName;
- db->b_Lib.lib_Flags = LIBF_CHANGED | LIBF_SUMUSED;
- db->b_Lib.lib_Version = VERSION;
- db->b_Lib.lib_Revision = REVISION;
- db->b_Lib.lib_IdString = ID;
- db->b_Segment = seg;
-
- /*
- * online at last!
- */
- AddDevice((struct Device *)db);
-
- }
-
- return(db);
- }
-
- void NewList(struct List *list)
- {
- list->lh_Head = (struct Node *)&list->lh_Tail;
- list->lh_Tail = NULL;
- list->lh_TailPred = (struct Node *)&list->lh_Head;
- }
-